! associate 可以表达函数表达式的值，也可以对变量进行浅、深复制
program main

    implicit none
    integer :: a, b

    a = 1; b = 2
    associate (c => a + b)          ! 函数表达式
        print *, c                  ! 3
    end associate

    associate (c => a, d => (a))    ! 浅复制、深复制
        print *, a, loc(a)          ! 1 8101297068
        print *, c, loc(c)          ! 1 8101297068
        print *, d, loc(d)          ! 1 8101297060
    end associate

end program main
